<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>双随机事项管理管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sx/drSx/">双随机事项列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="drSx" action="${ctx}/sx/drSx/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>制定部门：</label>
				<sys:treeselect id="office_zd" name="officeZdQuery.id" value="${drSx.officeZdQuery.id}" labelName="officeZdQuery.name" labelValue="${drSx.officeZdQuery.name}"
					title="制定部门" url="/sys/office/treeData?type=2&userOfficeId=${fns:getUser().getOffice().id}" cssClass="input-medium" allowClear="true" notAllowSelectParent="false"/>
			</li>  
			<li><label>事项名称：</label>
            	<form:input path="sxMc" htmlEscape="false" maxlength="50" class="input-xlarge"/>
			</li>
            <li class="clearfix"></li>
			<li><label>管理部门：</label>
				<sys:treeselect id="office_gl" name="officeGl.id" value="${drSx.officeGl.id}" labelName="officeGl.name" labelValue="${drSx.officeGl.name}"
					title="管理部门" url="/sys/office/treeData?type=2" cssClass="input-medium" allowClear="true" notAllowSelectParent="false"/>
			</li> 
            <li><label>法定事项：</label>
            	<form:select path="sxFdsx" class="input-xlarge">
					<form:option value="" label="请选择"/>
					<form:options items="${fns:getDictList('sys_user_could')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>                         
            <li><label>是否自定义：</label>
            	<form:radiobuttons path="sxZdy" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</li>            
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
            	<th style="width:275px;">事项名称</th>
                <th>是否为自定义</th>
                <th style="width:275px;">法定事项</th>
                <th>事项类型</th>
            	<th>制定部门</th>
                <th>管理部门</th>
				<th>创建人</th>
                <th>创建时间</th>
				<shiro:hasPermission name="sx:drSx:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="drSx">
			<tr>
            <c:choose>
            <c:when test="${drSx.createBy.id eq fns:getUser().id}">
            	<td><c:if test="${drSx.sxZdy eq '0'}">
                    	<a href="${ctx}/sx/drSx/formview?id=${drSx.id}">${drSx.sxMc}</a>
                    </c:if>
                	<c:if test="${drSx.sxZdy eq '1'}">
                    	<a href="${ctx}/sx/drSx/zdyformview?id=${drSx.id}">${drSx.sxMc}</a>
                    </c:if>  
                </td>
            </c:when>  
            <c:otherwise>
            	<td><c:if test="${drSx.sxZdy eq '0'}">
                    	<a href="${ctx}/sx/drSx/formview?id=${drSx.id}">${drSx.sxMc}</a>
                    </c:if>
                	<c:if test="${drSx.sxZdy eq '1'}">
                    	<a href="${ctx}/sx/drSx/zdyformview?id=${drSx.id}">${drSx.sxMc}</a>
                    </c:if>  
                </td>
            </c:otherwise>
            </c:choose>
                <td>${fns:getDictLabel(drSx.sxZdy, 'yes_no', '')}</td>
            <c:choose>
            <c:when test="${drSx.sxFlag eq '04'}">
            	<td>${fns:getDictLabel(drSx.sxFdsx, 'sys_user_could_tjj', '')}</td>
            </c:when>  
            <c:otherwise>
            	<td>${fns:getDictLabel(drSx.sxFdsx, 'sys_user_could', '')}</td>
            </c:otherwise>
            </c:choose>  
            <c:choose>
            <c:when test="${drSx.sxFlag eq '01'}">
            	<td>总局事项</td>
            </c:when> 
            <c:when test="${drSx.sxFlag eq '02'}">
            	<td>自定义事项</td>
            </c:when> 
            <c:when test="${drSx.sxFlag eq '03'}">
            	<td>天津局日常施检工作事项</td>
            </c:when>
            <c:when test="${drSx.sxFlag eq '04'}">
            	<td>天津局事项</td>
            </c:when>            
            <c:otherwise>
            	<td></td>
            </c:otherwise>
            </c:choose>                           
            	<td>${drSx.officeZd.name}</td>
                <td>${drSx.officeGl.name}</td>
                <td>${drSx.createBy.name}</td>
				<td>
					<fmt:formatDate value="${drSx.createDate}" pattern="yyyy-MM-dd"/>
				</td>
				<shiro:hasPermission name="sx:drSx:edit"><td>
                <c:if test="${drSx.createBy.id eq fns:getUser().id}">
                	<a href="${ctx}/sys/user/list_zj?sxId=${drSx.id}">执法人员库</a>&nbsp;
                    <a href="${ctx}/zfdxktitle/drZfdxkTitle/form?id=${drSx.id}">执法对象库</a>&nbsp;
                	<c:if test="${drSx.sxZdy eq '0'}">
                    	<a href="${ctx}/sx/drSx/form?id=${drSx.id}">修改</a>&nbsp;
                    </c:if>
                	<c:if test="${drSx.sxZdy eq '1'}">
                    	<a href="${ctx}/sx/drSx/zdyform?id=${drSx.id}">修改</a>&nbsp;
                    </c:if>    				
					<a href="${ctx}/sx/drSx/delete?id=${drSx.id}" onClick="return confirmx('确认要删除该双随机事项吗？', this.href)">删除</a>
                </c:if>      
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>